package teaching.io.base;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

/**
 * 字节输出流示例。
 * 
 * @author deng.zhao
 * @version 1.0 2018/03/28
 *
 */
public class OutputStreamExample {

	public static void main(String[] args) {

		String str = "你好，世界。";
		
		try (OutputStream os = new FileOutputStream("d:/test.dat");) {
			os.write(str.getBytes());
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}

		System.out.println("DONE!");
	}

}
